package xidian.vlab.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import xidian.vlab.dto.ImageDTO;
import xidian.vlab.dto.QueryDTO;
import xidian.vlab.dto.ResJsonDTO;
import xidian.vlab.service.StackService;

@RestController
@RequestMapping("/stack")
public class StackController {
    @Autowired
    private StackService stackService;

    @GetMapping("/images")
    public ResJsonDTO getImages(QueryDTO query){
        return stackService.getImages(query);
    }
    @PostMapping("/image")
    public ResJsonDTO uploadImage(ImageDTO imageForm){
        return stackService.uploadImage(imageForm);
    }
    @DeleteMapping("/image")
    public ResJsonDTO deleteImage(QueryDTO query){
        return stackService.deleteImage(query);
    }
    @GetMapping("/host")
    public ResJsonDTO getHost(QueryDTO query){
        return stackService.getHost(query);
    }

}
